package pers.cj.pdos.service;

import org.apache.ibatis.annotations.Param;
import pers.cj.pdos.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.vo.InGoodsOrderVo;
import pers.cj.pdos.vo.InGoodsVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface IInGoodsService extends IService<InGoods> {

    boolean checkNo(String no, String companyId);

    void insert(BusinessSet businessSet, InGoods inGoods, List<InGoodsGoods> inGoodsGoodsList, List<GoodsSn> goodsSnList, List<GoodsSnLog> goodsSnLogList);

    List<InGoodsVo> listVo(String companyId,
                           Integer page,
                           Integer limit,
                           Boolean close,
                           String search,
                           String no,
                           String goodsName,
                           String remark,
                           String provider,
                           Date makeTime1,
                           Date makeTime2,
                           String storeId,
                           String userStoreId,
                           String userId,
                           Date date1,
                           Date date2,
                           Date date,
                           String providerId,
                           String houseId,
                           String makeUserId);

    long count(String companyId,
               Boolean close,
               String search,
               String no,
               String goodsName,
               String remark,
               String provider,
               Date makeTime1,
               Date makeTime2,
               String storeId,
               String userStoreId,
               String userId,
               Date date1,
               Date date2,
               Date date,
               String providerId,
               String houseId,
               String makeUserId);

    List<InGoodsVo> listVoForSelect(String companyId,
                                    Integer page,
                                    Integer limit,
                                    String storeId,
                                    String userStoreId,
                                    String userId,
                                    String search);

    Long countForSelect(String companyId,
                        String storeId,
                        String userStoreId,
                        String userId,
                        String search);

    /**
     * 根据id获取进货详情，同时进货单下商品的sn也进行了处理
     * @param id
     * @return
     */
    InGoodsVo getVoById(String id);



    List<InGoodsVo> listVoByIds(List<String> ids);

    void close(InGoods inGoods, BusinessSet businessSet);

    List<InGoodsVo>  listVoByInGoodsOrder(String inGoodsOrderId);

    boolean checkClose(InGoods inGoods);

    boolean checkByInGoodsOrder(String inGoodsOrderId);

    List<InGoodsVo> listVoByBorrowInId(String borrowInId);
}
